﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HiCore.Extensions.UnitOfWork.EntityFramework.Domain;

namespace HiCore.WebApi.Example.DbContexts.DbEntity
{
    public abstract class AuditableEntityAggregateRoot<TKey> : AggregateRoot<TKey>, IEntity<TKey>, IAuditableEntity
    {
        /// <summary>
        /// 租户ID
        /// </summary>
        public long TenantId { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public long CreatedUserId { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTimeOffset CreatedTime { get; set; }

        /// <summary>
        /// 最后修改人
        /// </summary>
        public long LastUpdatedUserId { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTimeOffset LastUpdatedTime { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDeleted { get; set; }

        /// <summary>
        /// 删除人
        /// </summary>
        public long DeleteUserId { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTimeOffset DeleteTime { get; set; }
    }

    public abstract class AuditableEntityAggregateRoot : AggregateRoot, IEntity, IAuditableEntity
    {
        /// <summary>
        /// 租户ID
        /// </summary>
        public long TenantId { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public long CreatedUserId { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTimeOffset CreatedTime { get; set; }

        /// <summary>
        /// 最后修改人
        /// </summary>
        public long LastUpdatedUserId { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTimeOffset LastUpdatedTime { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDeleted { get; set; }

        /// <summary>
        /// 删除人
        /// </summary>
        public long DeleteUserId { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTimeOffset DeleteTime { get; set; }
    }
}
